import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// import { useStore } from '@/store/user'
import { asyncRouters, defaultRouters } from './config.router'
const routes: Array<RouteRecordRaw> = defaultRouters.concat(asyncRouters)

const router = createRouter({
  history: createWebHistory(),
  routes
})

router.beforeEach((to) => {
  // const store = useStore()
  // if (to.path !== '/login' && !store.token) {
  //   return '/login'
  // }
})

export default router
